package com.neutech.neusys.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.neutech.neusys.po.Department;
import com.neutech.neusys.service.DepartmentService;


@RestController
@RequestMapping("/his/department")
public class DepartmentController {
	@Autowired
	private DepartmentService departmentService;
	@RequestMapping(value="/addDepartment",method=RequestMethod.POST)
	public String addNewDepartment(Department department){
		int result  = departmentService.addDepartment(department);
		if(result == 1){
			return "success";
		}else{
			return "error";
		}
	}
	@RequestMapping("/toQueryDepartment")
	public List<Department> queryDepartment(){
		return  departmentService.toQueryDepartment();		
	}
}
